
#pragma once
#include "stdafx.h"

class CWicPalette : public IWICPalette, public QvObject
{
public:
    CWicPalette(void);
    CWicPalette(CWicPalette const &);
    virtual ~CWicPalette(void);
    CWicPalette& operator=(CWicPalette const &);

public:
    virtual HRESULT STDMETHODCALLTYPE InitializePredefined( 
        /* [in] */ WICBitmapPaletteType ePaletteType,
        /* [in] */ BOOL fAddTransparentColor);

    virtual HRESULT STDMETHODCALLTYPE InitializeCustom( 
        /* [size_is][in] */ __RPC__in_ecount_full(cCount) WICColor *pColors,
        /* [in] */ UINT cCount);

    virtual HRESULT STDMETHODCALLTYPE InitializeFromBitmap( 
        /* [in] */ __RPC__in_opt CWicBitmapSource *pISurface,
        /* [in] */ UINT cCount,
        /* [in] */ BOOL fAddTransparentColor);

    virtual HRESULT STDMETHODCALLTYPE InitializeFromPalette( 
        /* [in] */ __RPC__in_opt CWicPalette *pIPalette);

    virtual HRESULT STDMETHODCALLTYPE GetType( 
        /* [out] */ __RPC__out WICBitmapPaletteType *pePaletteType);

    virtual HRESULT STDMETHODCALLTYPE GetColorCount( 
        /* [out] */ __RPC__out UINT *pcCount);

    virtual HRESULT STDMETHODCALLTYPE GetColors( 
        /* [in] */ UINT cCount,
        /* [size_is][out] */ __RPC__out_ecount_full(cCount) WICColor *pColors,
        /* [out] */ __RPC__out UINT *pcActualColors);

    virtual HRESULT STDMETHODCALLTYPE IsBlackWhite( 
        /* [out] */ __RPC__out BOOL *pfIsBlackWhite);

    virtual HRESULT STDMETHODCALLTYPE IsGrayscale( 
        /* [out] */ __RPC__out BOOL *pfIsGrayscale);

    virtual HRESULT STDMETHODCALLTYPE HasAlpha( 
        /* [out] */ __RPC__out BOOL *pfHasAlpha);

    IWICPalette* GetPtr();

private:
    IWICPalette  *m_pIWICPalette;
};

